from pydantic import BaseModel
from typing import List,Optional

# 装本地聊天记录的
class ChatMessage(BaseModel):
    role:str
    content:str
    timestamp:str


# 用来装聊天记录
class ChatHistoryResponse(BaseModel):
    message:List[ChatMessage]


# 前端传过来的
class ChatRequest(BaseModel):

    message:str


# 定义单个聊天历史项的模型
class ChatHistoryItem(BaseModel):
    content: str       # 消息内容
    isAI: bool         # 是否为AI发送
    timestamp: str     # 时间戳

# 聊天历史响应模型
class ChatHistoryResponseOther(BaseModel):
    code: int
    msg: str
    data: Optional[List[ChatHistoryItem]] = None
    total: int